<!--  -->
<template>
  <div>
    <ETable v-bind="tableConifg">

     <template #buttons="{ delAll }">
        <el-button   type="primary" @click="add()">添加</el-button>
        <el-button   type="danger" @click="delAll">批量删除</el-button>
     </template>
    
     <template #operation="{ row,del }">
        <el-button link type="primary" @click="edit(row.id)">修改</el-button>
        <el-button link type="danger" @click="del(row.id)">删除</el-button>
     </template>
    </ETable>
  </div>
</template>

<script lang="ts" setup>
import { reactive, toRefs, ref, onMounted } from "vue";
import ETable, { TableType } from "../../components/ETable.vue";
import { getAccountList, delAccount, delAccounts } from "../../apis/account/account";

const tableConifg: TableType = {
  loadData: getAccountList,
  columns: [
    { prop: "id", label: "序号" },
    { prop: "name", label: "姓名" },
    { prop: "mobile", label: "手机号" },
    { prop: "operation", slot: true, label: "操作", width: "200" },
  ],
  delelte: delAccount,
  delelteAll: delAccounts,
  isSearch:false
};

const edit=(id:number)=>{

    alert(id);
}
const add=()=>{

    alert("add");
}
</script>
<style scoped></style>
